home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2003 September / PC Answers September 2003.iso / Software / freeware / pixeltoolbox / Setup.exe / Main / PixelToolbox.exe / PixelToolbox.dxr / Scripts_12_mouse script - grid & window.ls < prev    next >
Encoding:
Text File  |  2002-06-08  |  2.9 KB  |  123 lines

  1. property pMySprite, pMyMember, pMyMember2, pMyMember3, pMyGridNum
  2. global gSize
  3.  
  4. on beginSprite me
  5.   pMySprite = sprite(me.spriteNum)
  6.   pMyMember = pMySprite.memberNum
  7.   pMyMember2 = pMyMember - 1
  8.   pMyMember3 = pMyMember + 1
  9.   pMyGridNum = sprite(2).memberNum
  10. end
  11.  
  12. on mouseEnter me
  13.   set the memberNum of sprite pMySprite to pMyMember3
  14.   case the currentSpriteNum of
  15.     "42":
  16.       put "Toggle grid visibility. (Space)" into field "status"
  17.     "234":
  18.       put "Launch the PixelToolbox User Guide. (Ctrl+H)" into field "status"
  19.     "238":
  20.       put "Minimize the PixelToolbox window. (Ctrl+M)" into field "status"
  21.     "239":
  22.       put "Close PixelToolbox. (Ctrl+Q)" into field "status"
  23.     "259":
  24.       put "Toggle grid overlay mode between normal and inverted." into field "status"
  25.     "273":
  26.       put "Toggle grid type between normal and perspective." into field "status"
  27.   end case
  28. end
  29.  
  30. on mouseLeave me
  31.   set the memberNum of sprite pMySprite to pMyMember
  32.   put EMPTY into field "status"
  33. end
  34.  
  35. on mouseDown me
  36.   repeat while the mouseDown
  37.     set the memberNum of sprite pMySprite to pMyMember2
  38.     updateStage()
  39.   end repeat
  40. end
  41.  
  42. on mouseUp me
  43.   set the memberNum of sprite pMySprite to pMyMember3
  44.   case the currentSpriteNum of
  45.     "42":
  46.       showHideGrid()
  47.     "234":
  48.       launchGuide()
  49.     "238":
  50.       appMinimize()
  51.     "239":
  52.       quitPixelToolbox()
  53.     "259":
  54.       invertGrid()
  55.     "273":
  56.       perspectiveGrid()
  57.   end case
  58. end
  59.  
  60. on showHideGrid
  61.   if sprite(2).blend = 100 then
  62.     sprite(2).blend = 0
  63.   else
  64.     sprite(2).blend = 100
  65.   end if
  66. end
  67.  
  68. on invertGrid
  69.   if sprite(2).ink = 36 then
  70.     sprite(2).ink = 2
  71.   else
  72.     sprite(2).ink = 36
  73.   end if
  74. end
  75.  
  76. on perspectiveGrid
  77.   if sprite(2).memberNum = pMyGridNum then
  78.     if gSize = "48" then
  79.       sprite(2).memberNum = 462
  80.     else
  81.       sprite(2).memberNum = 461
  82.     end if
  83.   else
  84.     sprite(2).memberNum = pMyGridNum
  85.   end if
  86. end
  87.  
  88. on quitPixelToolbox
  89.   if the frame < 30 then
  90.     quit()
  91.   else
  92.     if sprite(1).pUndoTrigger then
  93.       if field("file status") = EMPTY then
  94.         newDocCheck = baMsgBox("Save current project before exiting?", "Save First?", "YesNoCancel", "Question", 3)
  95.         if newDocCheck = "Yes" then
  96.           saveAsColorPattern()
  97.         else
  98.           if newDocCheck = "Cancel" then
  99.             pass()
  100.           end if
  101.         end if
  102.       else
  103.         newDocCheck = baMsgBox("Save changes to current project before exiting?", "Save First?", "YesNoCancel", "Question", 3)
  104.         if newDocCheck = "Yes" then
  105.           saveColorPattern()
  106.         else
  107.           if newDocCheck = "Cancel" then
  108.             pass()
  109.           end if
  110.         end if
  111.       end if
  112.     end if
  113.     repeat with i = 1 to 32
  114.       writeCustomColors = baWriteIni("Custom Colors", "Color" & string(i), line i of field "custom colors", the moviePath & "PixelToolbox.ini")
  115.       if writeCustomColors = 0 then
  116.         alert("Could not save custom colors.")
  117.         exit repeat
  118.       end if
  119.     end repeat
  120.     quit()
  121.   end if
  122. end
  123.